/**
 * Created by Administrator on 2016/6/15.
 */

//登录的判断
var petname = $.cookie('petname');
if(petname){
    //如果存在的情况下，说明用户已经登录
    $('.out').css('display','none');
    $('.in').find('.dropdown-toggle').html(petname + '<span class = "caret"></span>');
    $('.in').css('display','block');
}else {
    //如果不存在的话说明用户没有登录
    $('.in').css('display','none');
    $('.out').css('display','block');
}
//退出
$('.dropdown-menu li:nth-child(3)').click(function(){
    $.get('/signout',null,function(data){
        if (data.code == 'success'){
            location.href = "/";
        }
    })
})